<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>注册</title>
    <!-- <link rel="shortcut icon" href="static/favicon.ico" type="image/x-icon"> -->
    <link rel="stylesheet" type="text/css" href="/static/css/reset.css" />
    <link rel="stylesheet" type="text/css" href="/static/css/register.css" />
</head>

<body>
    <div class="pos">
        <div class="login">
            <span class="close iconfont icon-close"></span>
            <img src="/static/img/login/loginlogo.png" alt="">
            <ul>
                <li></li>
                <li class="phone">注册</li>
                <li></li>
            </ul>

            <input style="margin-top: 0;" type="text" name="username" id="username" placeholder="请输入您的用户名">

            <input type="password" name="password" id="password" placeholder="请输入密码">

            <input type="password" name="repwd" id="repwd" placeholder="请再次输入密码">
            <!-- <span class="tips">密码或账号不对</span> -->
            <input type="file" name="f1" />
            <hr>
            <div class="clear"></div>
            <button class="loginbtn">注册</button>



            <p>
                <input type="checkbox" class="xuanze" />
                <span><a href="javascript:;">我同意 《用户使用协议》</a></span>
                <span>
                    已有账号
                    <a href="javascript:;">去登陆</a>
                </span>
            </p>
        </div>
    </div>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script>

        let username = $('#username')
        let password = $('#password')
        let repwd = $('#repwd')
    
        $('.loginbtn').on('click', function () {
            // console.log(username.val(),password.val(),repwd.val());
            $.ajax({
                url: '/register',
                method: 'post',
                data: { username:username.val(), password:password.val(), repwd:repwd.val() },
                success: function (res) {
                    console.log(res.msg)
                },
                error: function (err) {
                    console.log(err, '失败的回调')
                }
            })
        })
    </script>
</body>

</html>